<template>
<div>
  <TypeNav/>
  <ListContainer/>
  <TodayRecommend/>
  <Rank/>
  <Like/>
  <Floor v-for="floor in floorList" :key="floor.id" :list="floor" />
  <Brand/>
  </div>
</template>
<script>
import ListContainer from '@/pages/Home/ListContainer'
import TodayRecommend from '@/pages/Home/TodayRecommend'
import Rank from '@/pages/Home/Rank'
import Like from '@/pages/Home/Like'
import Floor from '@/pages/Home/Floor'
import Brand from '@/pages/Home/Brand'
import { mapState } from "vuex";
export default {
    name:'Home',
    // mounted() {
    //     console.log(this);
    // },
    components:{ListContainer,TodayRecommend,Rank,Like,Floor,Brand},
    mounted() {
        //派发action：通过Vuex发起ajax请求，将数据存储在仓库中
        this.$store.dispatch("getfloorList")
    },
    computed:{
        ...mapState({
            floorList:state=>state.home.floorList
        })
    },
}
</script>

<style>

</style>